package com.zbu.friend.controller;

import com.zbu.common.core.comtroller.BaseController;
import com.zbu.common.core.domain.R;
import com.zbu.common.message.service.AliSmsService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/test")
@Tag(name="测试接口")
public class TestControl extends BaseController {
    @Autowired
    private AliSmsService aliSmsService;
//    @Autowired
//    ITestService iTestService;
//    @Resource
//    RedisService redisService;
//    @RequestMapping("/list")
//    public List<?> list(){
//        return iTestService.list();
//    }
//    @GetMapping("/RedisAddAndGet")
//    public String RedisAddAndGet(){
//        SysUser sysUser=new SysUser();
//        sysUser.setUserAccount("redisTest");
//        redisService.setCacheObject("u4",sysUser);
//        SysUser sysUser1=redisService.getCacheObject("u4",SysUser.class);
//        return  sysUser1.toString();
//    }
//    @GetMapping("/add")
//    public String add() {
//        return iTestService.add();
//    }
//    @GetMapping("/validation")
//    public String validation(ValidationDTO validationDTO){
//        return "你好";
//    }
    @GetMapping("/sendCode")
    @Operation(summary = "验证码",description = "判断发送验证码是否成功")
    public R<Void> sendCode(String phone,String code){
        return toR(aliSmsService.sendMobileCode(phone,code));
    }
}
